import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    meta:{
     title:'首页',
     isNav:true,
     login:false,
    }
  },
  {
    path:'/car',
    name:'car',
    component: () => import('../views/Car/Car.vue'),
    meta:{
      title:'详情',
      isNav:true,
      login:true,
     }
  },
  {
    path:'/my',
    name:'my',
    component: () => import('../views/My/My.vue'),
    meta:{
      title:'我的',
      isNav:true,
      login:false,
     }
  },
  
  {
    path:'/login',
    name:'login',
    component: () => import('../views/My/Login.vue'),
    meta:{
      title:'登录',
      isNav:false,
      login:false,
     }
  },
  {
    path:'/register',
    name:'register',
    component: () => import('../views/My/Register.vue'),
    meta:{
      title:'注册',
      isNav:false,
      login:false,
     }
  },
  {
    path:'/type',
    name:'type',
    component: () => import('../views/Type/Type.vue'),
    meta:{
      title:'类型',
      isNav:false,
      login:false,
    }
  },{
    path:'/address',
    name:'address',
    component: () => import('../views/My/Address.vue'),
    meta:{
      title:'地址',
      isNav:false,
      login:true,
  }
},
{
  path:'/order',
  name:'order',
  component: () => import('../views/My/Order.vue'),
  meta:{
    title:'订单',
    isNav:false,
    login:true,
}
},
{
  path:'/addressAll',
  name:'addressAll',
  component: () => import('../views/My/AddressAll.vue'),
  meta:{
    title:'全部地址',
    isNav:false,
    login:true,
}
}
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
